home *** CD-ROM | disk | FTP | other *** search
/ Skunkware 5 / Skunkware 5.iso / src / X11 / tclMotif-1.4 / programs / progDH4.4 < prev    next >
Text File  |  1995-06-29  |  1KB  |  43 lines

  1.  
  2. # dan heller program 4.4, p108
  3.  
  4. # enter a command, execute it. place output in bottom window,
  5. # command in history list
  6.  
  7. xtAppInitialize -class Program
  8.  
  9. xmMainWindow .main managed
  10.  
  11. # menu with one button in one pulldown
  12. xmMenuBar .main.menuBar managed
  13. xmCascadeButton .main.menuBar.file managed -labelString File
  14. xmPulldownMenu .main.filePane
  15. .main.menuBar.file setValues -subMenuId .main.filePane
  16. xmPushButton .main.filePane.quit managed -labelString Quit
  17. .main.filePane.quit activateCallback "exit 0"
  18.  
  19. xmScrolledText .main.text managed \
  20.     -rows 5 \
  21.     -columns 40 \
  22.     -editable False \
  23.     -editMode Multi_line_edit
  24.  
  25. # ?? dont know what dan is doing with userData
  26.  
  27. xmCommand .main.command managed -promptString "Command:"
  28. .main.command commandEnteredCallback "exec_cmd {%value}"
  29.  
  30. .main setValues -menuBar .main.menuBar \
  31.         -commandWindow .main.command \
  32.         -workWindow [.main.text parent]
  33.  
  34. proc exec_cmd {command} {
  35.  
  36.     set comm_output [eval exec $command]
  37.     .main.text setValues -value $comm_output
  38. }
  39.  
  40. . realizeWidget
  41.  
  42. . mainLoop
  43.